// import VueRouter from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
const routes: any = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'index',
    meta: {
      title: "首页",
      hiddenTopBar: true
    },
    component: () => import('@/views/AppMain.vue')
  }
]
// Vue-router新版本中，需要使用createRouter来创建路由
const router = createRouter({
  // 指定路由的模式,此处使用的是hash模式
  history: createWebHashHistory(),
  routes // short for `routes: routes`
})

export default router
// const routes :any = []
// // 3. Create the router instance and pass the `routes` option
// // You can pass in additional options here, but let's
// // keep it simple for now.
// const router = VueRouter.createRouter({
//   // 4. Provide the history implementation to use. We are using the hash history for simplicity here.
//   history: VueRouter.createWebHashHistory(),
//   routes, // short for `routes: routes`
// })

/**
 * @description 路由拦截 beforeEach
 * */
// router.beforeEach(async (to, from, next) => {
//   // 动态设置标题
//   const title = import.meta.env.VITE_GLOB_APP_TITLE
//   document.title = to.meta.title ? (to.meta.title as string) : title
//   next()
// })
